package com.pingao.mp.utils;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class Md5 {
    public static String md5(String string){
        String hashAlgorithName = "MD5";
        int hashIterations = 1;//加密次数
        ByteSource credentialsSalt = ByteSource.Util.bytes("登录时输入的用户名");
        Object obj = new SimpleHash(hashAlgorithName, string, credentialsSalt, hashIterations);
        return obj.toString();
    }
}
